from django.conf.urls.defaults import *
from forum.views import *
from django.views.generic.simple import direct_to_template
from django.contrib.auth import views as auth_views
from django.conf import settings

urlpatterns = patterns('',

    url(r'^$',
        show_forums_index,
        name='forum_forums_index'),
        
    url(r'^register/$',
        register,
        name='registration_register'),
    
    url(r'^register/complete/$',
        direct_to_template,
        {'template': 'registration/registration_complete.html'},
        name='registration_complete'),
    
    url(r'^activate/(?P<activation_key>\w+)/$',
        activate,
        name='registration_activate'),
    
    url(r'^login/$',
        auth_views.login,
        {'template_name': 'registration/login.html'},
        name='auth_login'),
    
    url(r'^logout/$',
        auth_views.logout,
        {'next_page':settings.LOGIN_REDIRECT_URL,'template_name': 'registration/logout.html'},
        name='auth_logout'),
    
    url(r'^reset_password/$',
        auth_views.password_reset,
        {'template_name': 'registration/password_reset_form.html'},
        name='auth_reset_password'),
    
    url(r'^reset_password_done/$',
        auth_views.password_reset_done,
        {'template_name': 'registration/password_reset_done.html'},
        name='auth_reset_password_done'),
    
    url(r'^reset_password_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
        auth_views.password_reset_confirm,
        {'template_name': 'registration/password_reset_confirm.html'},
        name='auth_reset_password_confirm'),
    
    url(r'^reset_password_complete/$',
        auth_views.password_reset_complete,
        {'template_name': 'registration/password_reset_complete.html'},
        name='auth_reset_password_complete'),
        
    url(r'^settings/$',
        user_settings,
        name='forum_user_settings'),
    
    url(r'^member/(?P<user_id>\d+)/$',
        user_profile,
        name='forum_user_profile'),
    
    url(r'^(?P<forum_id>\d+)/new_topic/$',
        new_topic,
        name='forum_new_topic'),
    
    url(r'^topic/(?P<topic_id>\d+)/new_post/$',
        new_post,
        name='forum_new_post'),
    
    url(r'^post/(?P<post_id>\d+)/$',
        enter_post,
        name='forum_enter_post'),
    
    url(r'^post/(?P<post_id>\d+)/edit/$',
        edit_post,
        name='forum_edit_post'),
    
    url(r'^(?P<forum_id>\d+)/topics/$',
        enter_forum,
        name='forum_enter_forum'),
    
    url(r'^topic/(?P<topic_id>\d+)/$',
        enter_topic,
        name='forum_enter_topic'),
        
)
